package code04_循环结构;

public class Test02_do_while {
	public static void main(String[] args) {
		/*
		 * 输出5次HelloWorld
		 */
		int i = 1;
		do {
			System.out.println("Hello World");
			i++;
		} while (i <= 5);

		/*
		 * 计算1到50之间7的倍数之和
		 */
		i = 1;
		int sum = 0;
		do{
			if(i%7 == 0){				
				sum += i;
			}
			i++;  // 每次循环i都要递增1
		}while(i<=50);
		System.out.println("总和为："+sum);
	}
}
